package com.zzgele.qmzb.api.web;

import com.alibaba.boot.dubbo.annotation.DubboConsumer;
import com.zzgele.qmzb.api.core.Result;
import com.zzgele.qmzb.api.core.ResultGenerator;
import com.zzgele.qmzb.api.service.ScriptService;
import com.zzgele.qmzb.api.utils.PageUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * 获取后台的安卓apk信息
 * create by jack
 */
@RequestMapping("/script")
@RestController
public class ScriptController {
    private final Logger logger = LoggerFactory.getLogger(ScriptController.class);
    @DubboConsumer
    private ScriptService scriptService;

    @PostMapping("/getApk")
    public Result getApk() {
        PageUtil.startPage(1, 1);
        HashMap map = new HashMap();
        List<HashMap> list = scriptService.getList(map);
        if (list.size()==1){
            return ResultGenerator.genSuccessResult(list);
        }else{
            return ResultGenerator.genFailResult("空");
        }
    }
}
